home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 015a / do1003.zip / CLEANSCR.SCR < prev    next >
Text File  |  1991-12-27  |  2KB  |  64 lines

  1. *┌────────────────────────────────────────────────────────┐
  2. *│ SCRIPT: CleanScr -- Removes comment lines from scripts │
  3. *└────────────────────────────────────────────────────────┘
  4. /STOP End
  5. .clr
  6. »by«  CleanScript (Version 1, 11-19-91)  »#«
  7. * If parameter is not set, it will not be substituted.
  8. /IF %CleanScr01 EQ "" PROCESS
  9. :GetScriptName
  10. *
  11. * Use the /GETS command to get the name of the script
  12. Enter the name of the script.  Be sure to include the extension
  13. if it is not the default "»ye«SCR»#«".  Press »bo«<Enter>»#« to abort.
  14.  
  15. /SET Default ""
  16. /GETS CleanScr01 Default "»ye«ScriptName»gy«:»#«" 40 UC
  17. :PROCESS
  18. /IF %CleanScr01 NE "" END
  19. *
  20. * Use the LK operator to check to see if the user has entered
  21. * an extension
  22. /IF %CleanScr01 NL "*.*" CheckCorrect
  23. /SET CleanScr01 %CleanScr01.SCR
  24. :CheckCorrect
  25. /GOTOC "Process %CleanScr01 (Y/N)?" YN
  26. :N
  27. /GOTO GetScriptName
  28. :Y
  29. /EXIST %CleanScr01
  30. :EXISTERROR
  31. .clr bell
  32.  
  33.     %CleanScr01 DOES NOT EXIST!
  34.  
  35. :GOTO GetScriptName
  36. :EXISTOK
  37. »bo«Processing: %CleanScr01»#«
  38. /OPEN 1 %CleanScr01 R
  39. /OPEN 2 @cpy(%CleanScr01,1,@pos(%CleanScr01,"."))CLN W
  40. :ReadRecord
  41. /READ 1 " " Line
  42. * Use InKey to abort program before it finishes processing if
  43. * <esc> (027) pressed
  44. /INKEY ~027 EOF
  45. * Use the backslash to indicate an actual asterisk ("*") followed
  46. * by any other character.
  47. /IF %FileBuffer NL "\**" ReadRecord
  48. /WRITE 2 %FileBuffer
  49. .reset
  50. %FileBuffer
  51. /GOTO ReadRecord
  52. * Jump to here if there is a read error
  53. :READERROR
  54. .bell
  55. »re«    ERROR READING »ye«%CleanScr01»#«!
  56. :EOF
  57. * Jump to here at end-of-file
  58. /CLOSE 1
  59. /CLOSE 2
  60. :END
  61. * Clear all the variables used.
  62. /ENDEXEC CLEAR
  63. * End of CleanScript
  64.